-
Notifications
You must be signed in to change notification settings - Fork 51
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(autoware_path_generator): function to smooth the path #227
feat(autoware_path_generator): function to smooth the path #227
Conversation
Description: This commit is kind of feature porting from `autoware.universe` as follows * Import `PathWithLaneId DefaultFixedGoalPlanner::modifyPathForSmoothGoalConnection` from the following `autoware.universe` code https://github.com/autowarefoundation/autoware.universe/blob/a0816b7e3e35fbe822fefbb9c9a8132365608b49/planning/behavior_path_planner/autoware_behavior_path_goal_planner_module/src/default_fixed_goal_planner.cpp#L74-L104 * Also import all related functions from the `autoware.universe` side Signed-off-by: Junya Sasaki <junya.sasaki@tier4.jp>
Thank you for contributing to the Autoware project! 🚧 If your pull request is in progress, switch it to draft mode. Please ensure:
|
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #227 +/- ##
===========================================
- Coverage 78.75% 10.38% -68.37%
===========================================
Files 11 121 +110
Lines 193 10272 +10079
Branches 73 1680 +1607
===========================================
+ Hits 152 1067 +915
- Misses 11 8901 +8890
- Partials 30 304 +274
☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Signed-off-by: Junya Sasaki <junya.sasaki@tier4.jp>
Signed-off-by: Junya Sasaki <junya.sasaki@tier4.jp>
planning/autoware_path_generator/include/autoware/path_generator/utils.hpp
Outdated
Show resolved
Hide resolved
planning/autoware_path_generator/include/autoware/path_generator/utils.hpp
Outdated
Show resolved
Hide resolved
Signed-off-by: Junya Sasaki <junya.sasaki@tier4.jp> Co-authored-by: Kosuke Takeuchi <kosuke.tnp@gmail.com>
Signed-off-by: Junya Sasaki <junya.sasaki@tier4.jp> Co-authored-by: Kosuke Takeuchi <kosuke.tnp@gmail.com>
* Enhance error handlings * Remove unused variables * Simplify the code * Improve readability a little bit Signed-off-by: Junya Sasaki <junya.sasaki@tier4.jp>
…sasakisasaki/autoware.core into feat-embed-smooth-path-as-alpha-quality Signed-off-by: Junya Sasaki <junya.sasaki@tier4.jp>
Signed-off-by: Junya Sasaki <junya.sasaki@tier4.jp>
* This fix is for the following PR: autowarefoundation/autoware.core#227 Signed-off-by: Junya Sasaki <junya.sasaki@tier4.jp>
Signed-off-by: Junya Sasaki <junya.sasaki@tier4.jp>
Signed-off-by: Junya Sasaki <junya.sasaki@tier4.jp>
* This comment is wrote because of my misunderstanding Signed-off-by: Junya Sasaki <junya.sasaki@tier4.jp>
Signed-off-by: Junya Sasaki <junya.sasaki@tier4.jp>
Signed-off-by: Junya Sasaki <junya.sasaki@tier4.jp>
Fixing error in some CI checks. |
Signed-off-by: Junya Sasaki <junya.sasaki@tier4.jp>
…sasakisasaki/autoware.core into feat-embed-smooth-path-as-alpha-quality Signed-off-by: Junya Sasaki <junya.sasaki@tier4.jp>
Signed-off-by: Junya Sasaki <junya.sasaki@tier4.jp>
planning/autoware_path_generator/test/test_path_generator_node_interface.cpp
Show resolved
Hide resolved
Signed-off-by: Junya Sasaki <junya.sasaki@tier4.jp>
Signed-off-by: Junya Sasaki <junya.sasaki@tier4.jp>
@kosuke55 Now the final tests are running. |
* It seems zero pre goal velocity makes scenario fail - We need to insert appropriate velocity for pre goal Signed-off-by: Junya Sasaki <junya.sasaki@tier4.jp>
Sorry, the final tests failed. Now let me put the final of final test results here: |
Signed-off-by: Junya Sasaki <junya.sasaki@tier4.jp> Co-authored-by: Kosuke Takeuchi <kosuke.tnp@gmail.com>
Signed-off-by: Junya Sasaki <junya.sasaki@tier4.jp> Co-authored-by: Kosuke Takeuchi <kosuke.tnp@gmail.com>
Now ready 👍 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
( not tested after #227 (comment) )
I'm doing the double check purpose tests as this 👍. I'm going to merge this PR (with launch side together) after seeing the test results. |
Now test result on the evaluator looks good. |
Now let me merge with this launch side PR |
* feat(path_generator): add parameters (see below) * This fix is for the following PR: autowarefoundation/autoware.core#227 Signed-off-by: Junya Sasaki <junya.sasaki@tier4.jp> * Update autoware_launch/config/planning/scenario_planning/lane_driving/behavior_planning/path_generator/path_generator.param.yaml Signed-off-by: Junya Sasaki <junya.sasaki@tier4.jp> Co-authored-by: Kosuke Takeuchi <kosuke.tnp@gmail.com> --------- Signed-off-by: Junya Sasaki <junya.sasaki@tier4.jp> Co-authored-by: Kosuke Takeuchi <kosuke.tnp@gmail.com>
…oundation#227) * feat: function to smooth the route (see below) Description: This commit is kind of feature porting from `autoware.universe` as follows * Import `PathWithLaneId DefaultFixedGoalPlanner::modifyPathForSmoothGoalConnection` from the following `autoware.universe` code https://github.com/autowarefoundation/autoware.universe/blob/a0816b7e3e35fbe822fefbb9c9a8132365608b49/planning/behavior_path_planner/autoware_behavior_path_goal_planner_module/src/default_fixed_goal_planner.cpp#L74-L104 * Also import all related functions from the `autoware.universe` side Signed-off-by: Junya Sasaki <junya.sasaki@tier4.jp> * style(pre-commit): autofix * bugs: fix remaining conflicts Signed-off-by: Junya Sasaki <junya.sasaki@tier4.jp> * Update planning/autoware_path_generator/src/utils.cpp Signed-off-by: Junya Sasaki <junya.sasaki@tier4.jp> Co-authored-by: Kosuke Takeuchi <kosuke.tnp@gmail.com> * Update planning/autoware_path_generator/src/utils.cpp Signed-off-by: Junya Sasaki <junya.sasaki@tier4.jp> Co-authored-by: Kosuke Takeuchi <kosuke.tnp@gmail.com> * refactor: as follows * Enhance error handlings * Remove unused variables * Simplify the code * Improve readability a little bit Signed-off-by: Junya Sasaki <junya.sasaki@tier4.jp> * style(pre-commit): autofix * refactor: enhance error handling Signed-off-by: Junya Sasaki <junya.sasaki@tier4.jp> * style(pre-commit): autofix * bug: fix wrong function declaration in header Signed-off-by: Junya Sasaki <junya.sasaki@tier4.jp> * bug: fix wrong point index calculation Signed-off-by: Junya Sasaki <junya.sasaki@tier4.jp> * bug: remove meaningless comment * This comment is wrote because of my misunderstanding Signed-off-by: Junya Sasaki <junya.sasaki@tier4.jp> * fix: apply `pre-commit` Signed-off-by: Junya Sasaki <junya.sasaki@tier4.jp> * fix: smooth path before cropping trajectory points Signed-off-by: Junya Sasaki <junya.sasaki@tier4.jp> * bug: fix shadow variable Signed-off-by: Junya Sasaki <junya.sasaki@tier4.jp> * bug: fix missing parameters for `autoware_path_generator` Signed-off-by: Junya Sasaki <junya.sasaki@tier4.jp> * bug: fix by cpplint Signed-off-by: Junya Sasaki <junya.sasaki@tier4.jp> * style(pre-commit): autofix * bug: apply missing fix proposed by cpplint Signed-off-by: Junya Sasaki <junya.sasaki@tier4.jp> * style(pre-commit): autofix * bug: `autoware_test_utils` should be in the `test_depend` Signed-off-by: Junya Sasaki <junya.sasaki@tier4.jp> * fix(autoware_path_generator): add maintainer and author Signed-off-by: Junya Sasaki <junya.sasaki@tier4.jp> * style(pre-commit): autofix * fix: by pre-commit * Sorry, I was forgetting to do this on my local env. Signed-off-by: Junya Sasaki <junya.sasaki@tier4.jp> * fix: smooth path only when a goal point is included Signed-off-by: Junya Sasaki <junya.sasaki@tier4.jp> * bug: do error handling Signed-off-by: Junya Sasaki <junya.sasaki@tier4.jp> * style(pre-commit): autofix * bug: fix wrong distance calculation * The goal position is generally separate from the path points Signed-off-by: Junya Sasaki <junya.sasaki@tier4.jp> * fix: remove sanity check temporary as following reasons * CI (especially unit tests) fails due to this sanity check * As this is out of scope for this PR, we will fix the bug where the start and end are reversed in another PR Signed-off-by: Junya Sasaki <junya.sasaki@tier4.jp> * refactor: fix complexity * We should start from the simple one * Then we can add the necessary optimization later Signed-off-by: Junya Sasaki <junya.sasaki@tier4.jp> * bug: missing fixes in the include header Signed-off-by: Junya Sasaki <junya.sasaki@tier4.jp> * bug: inconsistent function declaration * The type of returned value and arguments were wrong Signed-off-by: Junya Sasaki <junya.sasaki@tier4.jp> * Update planning/autoware_path_generator/include/autoware/path_generator/common_structs.hpp Signed-off-by: Junya Sasaki <junya.sasaki@tier4.jp> Co-authored-by: Kosuke Takeuchi <kosuke.tnp@gmail.com> * Update planning/autoware_path_generator/src/node.cpp Signed-off-by: Junya Sasaki <junya.sasaki@tier4.jp> Co-authored-by: Kosuke Takeuchi <kosuke.tnp@gmail.com> * Update planning/autoware_path_generator/src/utils.cpp Signed-off-by: Junya Sasaki <junya.sasaki@tier4.jp> Co-authored-by: Kosuke Takeuchi <kosuke.tnp@gmail.com> * Update planning/autoware_path_generator/src/utils.cpp Signed-off-by: Junya Sasaki <junya.sasaki@tier4.jp> Co-authored-by: Kosuke Takeuchi <kosuke.tnp@gmail.com> * style(pre-commit): autofix * fix: apply comment in the following PR * autowarefoundation#227 (comment) Signed-off-by: Junya Sasaki <junya.sasaki@tier4.jp> * fix: sorry, I was missing one comment to be applied Signed-off-by: Junya Sasaki <junya.sasaki@tier4.jp> * style(pre-commit): autofix * bug: fix wrong goal point interpolation Signed-off-by: Junya Sasaki <junya.sasaki@tier4.jp> * feat: add test case (goal on left side) Signed-off-by: Junya Sasaki <junya.sasaki@tier4.jp> * bug: fix as follows * Prevent name duplication (path_up_to_just_before_pre_goal) * Fix missing left/right bound * Goal must have zero velocity * Improve readability * Other minor fixes Signed-off-by: Junya Sasaki <junya.sasaki@tier4.jp> * bug: fix duplicated zero velocity set * Zero velocity is set after the removed lines by this commit Signed-off-by: Junya Sasaki <junya.sasaki@tier4.jp> * feat: add one test case (goal on left side) Signed-off-by: Junya Sasaki <junya.sasaki@tier4.jp> * Update planning/autoware_path_generator/src/utils.cpp Signed-off-by: Junya Sasaki <junya.sasaki@tier4.jp> Co-authored-by: Kosuke Takeuchi <kosuke.tnp@gmail.com> * fix: apply comment from reviewer Signed-off-by: Junya Sasaki <junya.sasaki@tier4.jp> * fix(package.xml): update maintainer for the following packages * `autoware_planning_test_manager` * `autoware_test_utils` Signed-off-by: Junya Sasaki <junya.sasaki@tier4.jp> * Update planning/autoware_path_generator/src/node.cpp Signed-off-by: Junya Sasaki <junya.sasaki@tier4.jp> Co-authored-by: Kosuke Takeuchi <kosuke.tnp@gmail.com> * Update planning/autoware_path_generator/src/utils.cpp Signed-off-by: Junya Sasaki <junya.sasaki@tier4.jp> Co-authored-by: Mitsuhiro Sakamoto <50359861+mitukou1109@users.noreply.github.com> * Update planning/autoware_path_generator/src/utils.cpp Signed-off-by: Junya Sasaki <junya.sasaki@tier4.jp> Co-authored-by: Mitsuhiro Sakamoto <50359861+mitukou1109@users.noreply.github.com> * bug: fix missing header in the path * This finally causes an issue that the vehicle cannot engage Signed-off-by: Junya Sasaki <junya.sasaki@tier4.jp> * bug: fix an issue that smooth connection does not work Signed-off-by: Junya Sasaki <junya.sasaki@tier4.jp> * refactor: simplify code Signed-off-by: Junya Sasaki <junya.sasaki@tier4.jp> * bug: fix wrong pose at the goal (see below) * If we return nullopt here, the original path whose goal position is located at the center line is used. * Unless far from the goal point, the path becomes smoothed one whose goal position is located at the side of road correctly. * But as the goal approaches very closely, the goal position is shifted from smoothed one to the original one * Thus, the goal pose finally becomes wrong due to the goal position shift Signed-off-by: Junya Sasaki <junya.sasaki@tier4.jp> * refactor: no need this line here Signed-off-by: Junya Sasaki <junya.sasaki@tier4.jp> * style(pre-commit): autofix * bug: fix so we follow the provided review comments Signed-off-by: Junya Sasaki <junya.sasaki@tier4.jp> * bug: sorry, this is unsaved fix, ... Signed-off-by: Junya Sasaki <junya.sasaki@tier4.jp> * cosmetic: fix wrong comment Signed-off-by: Junya Sasaki <junya.sasaki@tier4.jp> * bug: unused function `get_goal_lanelet()` remaining Signed-off-by: Junya Sasaki <junya.sasaki@tier4.jp> * bug: carefully handle the pre goal velocity * It seems zero pre goal velocity makes scenario fail - We need to insert appropriate velocity for pre goal Signed-off-by: Junya Sasaki <junya.sasaki@tier4.jp> * Update planning/autoware_path_generator/src/utils.cpp Signed-off-by: Junya Sasaki <junya.sasaki@tier4.jp> Co-authored-by: Kosuke Takeuchi <kosuke.tnp@gmail.com> * Update planning/autoware_path_generator/src/utils.cpp Signed-off-by: Junya Sasaki <junya.sasaki@tier4.jp> Co-authored-by: Kosuke Takeuchi <kosuke.tnp@gmail.com> * style(pre-commit): autofix --------- Signed-off-by: Junya Sasaki <junya.sasaki@tier4.jp> Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: Kosuke Takeuchi <kosuke.tnp@gmail.com> Co-authored-by: Mitsuhiro Sakamoto <50359861+mitukou1109@users.noreply.github.com>
* feat(path_generator): add parameters (see below) * This fix is for the following PR: autowarefoundation/autoware.core#227 Signed-off-by: Junya Sasaki <junya.sasaki@tier4.jp> * Update autoware_launch/config/planning/scenario_planning/lane_driving/behavior_planning/path_generator/path_generator.param.yaml Signed-off-by: Junya Sasaki <junya.sasaki@tier4.jp> Co-authored-by: Kosuke Takeuchi <kosuke.tnp@gmail.com> --------- Signed-off-by: Junya Sasaki <junya.sasaki@tier4.jp> Co-authored-by: Kosuke Takeuchi <kosuke.tnp@gmail.com>
…oundation#227) (#9) * feat: function to smooth the route (see below) Description: This commit is kind of feature porting from `autoware.universe` as follows * Import `PathWithLaneId DefaultFixedGoalPlanner::modifyPathForSmoothGoalConnection` from the following `autoware.universe` code https://github.com/autowarefoundation/autoware.universe/blob/a0816b7e3e35fbe822fefbb9c9a8132365608b49/planning/behavior_path_planner/autoware_behavior_path_goal_planner_module/src/default_fixed_goal_planner.cpp#L74-L104 * Also import all related functions from the `autoware.universe` side * style(pre-commit): autofix * bugs: fix remaining conflicts * Update planning/autoware_path_generator/src/utils.cpp * Update planning/autoware_path_generator/src/utils.cpp * refactor: as follows * Enhance error handlings * Remove unused variables * Simplify the code * Improve readability a little bit * style(pre-commit): autofix * refactor: enhance error handling * style(pre-commit): autofix * bug: fix wrong function declaration in header * bug: fix wrong point index calculation * bug: remove meaningless comment * This comment is wrote because of my misunderstanding * fix: apply `pre-commit` * fix: smooth path before cropping trajectory points * bug: fix shadow variable * bug: fix missing parameters for `autoware_path_generator` * bug: fix by cpplint * style(pre-commit): autofix * bug: apply missing fix proposed by cpplint * style(pre-commit): autofix * bug: `autoware_test_utils` should be in the `test_depend` * fix(autoware_path_generator): add maintainer and author * style(pre-commit): autofix * fix: by pre-commit * Sorry, I was forgetting to do this on my local env. * fix: smooth path only when a goal point is included * bug: do error handling * style(pre-commit): autofix * bug: fix wrong distance calculation * The goal position is generally separate from the path points * fix: remove sanity check temporary as following reasons * CI (especially unit tests) fails due to this sanity check * As this is out of scope for this PR, we will fix the bug where the start and end are reversed in another PR * refactor: fix complexity * We should start from the simple one * Then we can add the necessary optimization later * bug: missing fixes in the include header * bug: inconsistent function declaration * The type of returned value and arguments were wrong * Update planning/autoware_path_generator/include/autoware/path_generator/common_structs.hpp * Update planning/autoware_path_generator/src/node.cpp * Update planning/autoware_path_generator/src/utils.cpp * Update planning/autoware_path_generator/src/utils.cpp * style(pre-commit): autofix * fix: apply comment in the following PR * autowarefoundation#227 (comment) * fix: sorry, I was missing one comment to be applied * style(pre-commit): autofix * bug: fix wrong goal point interpolation * feat: add test case (goal on left side) * bug: fix as follows * Prevent name duplication (path_up_to_just_before_pre_goal) * Fix missing left/right bound * Goal must have zero velocity * Improve readability * Other minor fixes * bug: fix duplicated zero velocity set * Zero velocity is set after the removed lines by this commit * feat: add one test case (goal on left side) * Update planning/autoware_path_generator/src/utils.cpp * fix: apply comment from reviewer * fix(package.xml): update maintainer for the following packages * `autoware_planning_test_manager` * `autoware_test_utils` * Update planning/autoware_path_generator/src/node.cpp * Update planning/autoware_path_generator/src/utils.cpp * Update planning/autoware_path_generator/src/utils.cpp * bug: fix missing header in the path * This finally causes an issue that the vehicle cannot engage * bug: fix an issue that smooth connection does not work * refactor: simplify code * bug: fix wrong pose at the goal (see below) * If we return nullopt here, the original path whose goal position is located at the center line is used. * Unless far from the goal point, the path becomes smoothed one whose goal position is located at the side of road correctly. * But as the goal approaches very closely, the goal position is shifted from smoothed one to the original one * Thus, the goal pose finally becomes wrong due to the goal position shift * refactor: no need this line here * style(pre-commit): autofix * bug: fix so we follow the provided review comments * bug: sorry, this is unsaved fix, ... * cosmetic: fix wrong comment * bug: unused function `get_goal_lanelet()` remaining * bug: carefully handle the pre goal velocity * It seems zero pre goal velocity makes scenario fail - We need to insert appropriate velocity for pre goal * Update planning/autoware_path_generator/src/utils.cpp * Update planning/autoware_path_generator/src/utils.cpp * style(pre-commit): autofix --------- Signed-off-by: Junya Sasaki <junya.sasaki@tier4.jp> Co-authored-by: Junya Sasaki <j2sasaki1990@gmail.com> Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: Kosuke Takeuchi <kosuke.tnp@gmail.com> Co-authored-by: Mitsuhiro Sakamoto <50359861+mitukou1109@users.noreply.github.com>
Description
This is kind of feature porting from
autoware.universe
as followsPathWithLaneId DefaultFixedGoalPlanner::modifyPathForSmoothGoalConnection
from theautoware.universe
side codeautoware.universe
sideQuality of Code
The refactoring plan is mentioned in this issue.
Perhaps we can work on the refactoring with a few PRs. Please feel free to share your idea for the improvement of code quality. Thank you!
How was this PR tested?
We have two test strategies as follows.
Scenario Evaluator Tool Tests
Done as the following link (only can be seen via TIER IV internal)
https://evaluation.tier4.jp/evaluation/reports/dd25c135-9945-5991-adea-93fbe3eebac6?project_id=prd_jthttps://evaluation.tier4.jp/evaluation/reports/fcfaa1d3-0be2-5b41-a24e-66217fa3097f?project_id=prd_jtTests on Local Environment
vcs import
at around 18:00 JST on 26th Feb. 2025behavior_planning_launch_xml.txt
tier4_planning_component_launch_xml.txt
path_generator_param_yaml.txt
Screencast_psim.webm
Status of Additional Tests
(ADDED) It seems the tests on the evaluator shows a failed scenario link to failed one. I'm now investigating the issue.(success rate: 101/114) https://evaluation.tier4.jp/evaluation/reports/fcfaa1d3-0be2-5b41-a24e-66217fa3097f?project_id=prd_jtNotes for reviewers
Please do not enable auto merge as this PR needed to be merged with this launch side PR at the same time.
Please feel free to provide all the needed tests for merging this PR. I'm really happy for performing the tests 👍
Effects on system behavior
Needed to be investigated during the testing process.